import request from "@/utils/request";
import { object_Inf } from "@/utils/typings/index.type";
import moldRepair_APi from "../moldRepair";
/*
 * @Descripttion:模具+备件管理接口类
 * @LastEditors: xzh
 * @LastEditTime: 2023-09-11 17:38:39
 */
export default class moldSpare_APi extends moldRepair_APi {
  //#region 模具备件类型

  /**
   * @Author: xzh
   * @Descripttion:保存模具备件类型信息
   * @Param:
   * @param {object} data
   */
  static saveMoldMoldSpareType = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/MouldSparePartType/SaveMouldSparePartType",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除模具备件类型信息
   * @Param:
   * @param {Array} data
   */
  static deleteMoldSpareType = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/MouldSparePartType/DeleteMouldSparePartType",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 修改模具备件类型状态
   * @Param:
   * @param {Array} data
   */
  static updateMoldSpareTypeStatus = (
    data: Array<string>,
    status: boolean
  ): Promise<object_Inf> =>
    request({
      url: "/api/MouldSparePartType/UpdateMouldSparePartTypeStatus",
      method: "post",
      data: {
        ids: data,
        status,
      },
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取模具备件类型信息
   * @Param:
   * @param {number} id 模具备件类型主键
   */
  static getMoldSpareTypeInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/MouldSparePartType/GetMouldSparePartType",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取模具备件类型列表
   * @Param:
   */
  static getMoldSpareTypeList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<Array<object_Inf>> =>
    request({
      url: "/api/MouldSparePartType/GetMouldSparePartTypeList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion

  //#region 模具备件台账

  /**
   * @Author: xzh
   * @Descripttion:保存模具备件台账信息
   * @Param:
   * @param {object} data
   */
  static saveMoldSpareLedger = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/MouldSparePartLedger/SaveMouldSparePartLedger",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除模具备件台账信息
   * @Param:
   * @param {Array} data
   */
  static deleteMoldSpareLedger = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/MouldSparePartLedger/DeleteMouldSparePartLedger",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取模具备件台账信息
   * @Param:
   * @param {number} id 模具备件台账主键
   */
  static getMoldSpareLedgerInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/MouldSparePartLedger/GetMouldSparePartLedger",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取模具备件台账列表
   * @Param:
   */
  static getMoldSpareLedgerList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/MouldSparePartLedger/GetMouldSparePartLedgerList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  //#endregion

  //#region 入库管理

  /**
   * @Author: xzh
   * @Descripttion:保存入库信息
   * @Param:
   * @param {object} data
   */
  static saveMoldInBound = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/MouldSparePartStockIn/SaveMouldSparePartStockIn",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除入库信息
   * @Param:
   * @param {Array} data
   */
  static deleteMoldInBound = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/MouldSparePartStockIn/DeleteMouldSparePartStockIn",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取入库信息
   * @Param:
   * @param {number} id 入库主键
   */
  static getMoldInBoundInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/MouldSparePartStockIn/GetMouldSparePartStockIn",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取入库列表
   * @Param:
   */
  static getMoldInBoundList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/MouldSparePartStockIn/GetMouldSparePartStockInList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion

  //#region 出库管理

  /**
   * @Author: xzh
   * @Descripttion:保存出库信息
   * @Param:
   * @param {object} data
   */
  static saveMoldOutBound = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/MouldSparePartStockOut/SaveMouldSparePartStockOut",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除出库信息
   * @Param:
   * @param {Array} data
   */
  static deleteMoldOutBound = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/MouldSparePartStockOut/DeleteMouldSparePartStockOut",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取出库信息
   * @Param:
   * @param {number} id 出库主键
   */
  static getMoldOutBoundInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/MouldSparePartStockOut/GetMouldSparePartStockOut",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取出库列表
   * @Param:
   */
  static getMoldOutBoundList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/MouldSparePartStockOut/GetMouldSparePartStockOutList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion
}
